package com.ruoyi.sys.service.impl;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.db.mapper.AuthItemInfoMapper;
import com.ruoyi.db.domain.AuthItemInfo;
import com.ruoyi.sys.service.IAuthItemInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 实名子项值Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-07
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class AuthItemInfoServiceImpl implements IAuthItemInfoService 
{
    @Autowired
    private AuthItemInfoMapper authItemInfoMapper;

    /**
     * 查询实名子项值
     * 
     * @param id 实名子项值主键
     * @return 实名子项值
     */
    @Override
    public AuthItemInfo selectAuthItemInfoById(Long id)
    {
        return authItemInfoMapper.selectAuthItemInfoById(id);
    }

    /**
     * 查询实名子项值列表
     * 
     * @param authItemInfo 实名子项值
     * @return 实名子项值
     */
    @Override
    public List<AuthItemInfo> selectAuthItemInfoList(AuthItemInfo authItemInfo)
    {
        return authItemInfoMapper.selectAuthItemInfoList(authItemInfo);
    }

    /**
     * 查询实名子项值列表
     *
     * @param authItemInfo 实名子项值
     * @return 实名子项值
     */
    @Override
    public List<Map<String, Object>> selectAuthItemInfoListMap(AuthItemInfo authItemInfo)
    {
        return authItemInfoMapper.selectAuthItemInfoListMap(authItemInfo);
    }

    /**
     * 新增实名子项值
     * 
     * @param authItemInfo 实名子项值
     * @return 结果
     */
    @Override
    public int insertAuthItemInfo(AuthItemInfo authItemInfo)
    {
        authItemInfo.setCreateTime(DateUtils.getNowDate());
        return authItemInfoMapper.insertAuthItemInfo(authItemInfo);
    }

    /**
     * 修改实名子项值
     * 
     * @param authItemInfo 实名子项值
     * @return 结果
     */
    @Override
    public int updateAuthItemInfo(AuthItemInfo authItemInfo)
    {
        authItemInfo.setUpdateTime(DateUtils.getNowDate());
        return authItemInfoMapper.updateAuthItemInfo(authItemInfo);
    }

    /**
     * 批量删除实名子项值
     * 
     * @param ids 需要删除的实名子项值主键
     * @return 结果
     */
    @Override
    public int deleteAuthItemInfoByIds(String ids)
    {
        return authItemInfoMapper.deleteAuthItemInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除实名子项值信息
     * 
     * @param id 实名子项值主键
     * @return 结果
     */
    @Override
    public int deleteAuthItemInfoById(Long id)
    {
        return authItemInfoMapper.deleteAuthItemInfoById(id);
    }
}
